# import asyncio
#
# from entity.database.mysql import SessionAndHistory
# from utils.database_connector import DatabaseConnector
#
#
# '''
# 插入session和history的关联关系
# :param session_id: session id
# :param history_id: history id
# :return: None
# '''
# async def set_session_and_history(session_id:int,history_id:int) -> None:
#     # db = await DatabaseConnector().get_db()
#     # query = f"insert into session_and_history(session_id,history_id,created_time,updated_time) values({session_id},{history_id},now(),now())"
#     # result = db.run(query)
#     await SessionAndHistory.create(session_id=session_id,history_id=history_id)
# async def get_history_by_session_id(session_id:int) -> list:
#     # db = await DatabaseConnector().get_db()
#     # query = f"select history_id from session_and_history where session_id={session_id}"
#     # result = db.run(query)
#     result = await SessionAndHistory.filter(session_id=session_id).values_list("history_id")
#     return result
#
# # async def main():
# #     # result = await set_session_and_history(1,1)
# #     result = await get_history_by_session_id(1)
# #     print(type(result))
# #
# # if __name__ == "__main__":
# #     asyncio.run(main())